function retcode = chkdir(directory)

retcode = 0;

if ~exist(directory,'dir')
	mkdir(directory);
	retcode = 1;
end